import React, { Component } from 'react'
import axios from "axios"
import Top from "../component/top"
import Bottom from '../component/bottom'
class Home extends Component {
    state = {
        arr:[]
    }
    componentDidMount(){
        axios.get("/list").then(res=>{
            console.log(res.data)
            this.setState({
                arr:res.data
            })
        })
    }
    render() {
        let {arr} = this.state
        return (
            <div>
                {
                    arr&&arr.length?<Top send={arr}></Top>:""
                }
                {
                      arr&&arr.length? <Bottom send={arr}></Bottom>:""
                }
               
            </div>
        )
    }
}

export default Home
